/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved.
 * Description: Parse sps information from avc data
 * Author: HiMobileCam middleware develop team
 * Create: 2017-12-22
 */

#ifndef AVCPARSER_H
#define AVCPARSER_H

#include "hi_mw_type.h"

typedef struct AVCSpsInfo {
    HI_U32 chromaFormatIdc;           /* chroma_format_idc */
    HI_U32 picWidthInMbsMinus1;       /* pic_width_in_mbs_minus1 */
    HI_U32 picHeightInMapUnitsMinus1; /* pic_height_in_map_units_minus1 */
    HI_BOOL frameMbsOnlyFlag;         /* frame_mbs_only_flag */
    HI_BOOL adaptFrameFlieFlag;       /* mb_adaptive_frame_field_flag : 0 */
    HI_BOOL directInferenceFlag;      /* direct_8x8_inference_flag : 1 */
    HI_BOOL fameCroppingFlag;         /* frame_cropping_flag : 1 */
    HI_U32 frameCropLeftOffset;       /* frame_crop_left_offset : 0 */
    HI_U32 frameCropRightOffset;      /* frame_crop_right_offset : 0 */
    HI_U32 frameCropTopOffset;        /* frame_crop_top_offset : 0 */
    HI_U32 frameCropBottomOffset;     /* frame_crop_bottom_offset : 4 */
} AvcSpsInfo;

HI_BOOL FFAVCParserParseSps(AvcSpsInfo *outSpsInfo, const HI_U8 *sps, HI_U32 spsLen);
#endif
